package tech.summerly.weather.data.bean

import com.google.gson.JsonObject
import com.google.gson.annotations.Expose
import tech.summerly.weather.data.remote.CaiYunService
import tech.summerly.weather.model.Region
import java.io.Serializable

/**
 * 实时天气状况接口 result 字段信息
 */
data class RealTime(

        /**
         * 温度
         */
        val temperature: Float,

        /**
         * 天气概况
         */
        val skycon: String,

        /**
         * pm25值
         */
        val pm25: Int,

        val pm10: Int,

        val o3: Int,
        val co: Float,
        val no2: Int,
        val so2: Int,

        /**
         * 云量
         */
        val cloudrate: Float,

        /**
         * 相对湿度
         */
        val humidity: Float,

        /**
         * 空气质量
         */
        val aqi: Int,

        /**
         * 降水
         */
        val precipitation: JsonObject,

        /**
         * 风
         */
        val wind: Wind
) : Serializable {

    @Expose
    var region: Region? = null

    fun getSkyConString(): String = CaiYunService.SkyCon.getSkyConLocalString(skycon)

    fun getSkyCon() = CaiYunService.SkyCon(skycon)
}